import request from '@/utils/request'


//修改商品上下架状态
export function editStatus(query) {
  return request({
    url: '/shopping/mallProduct/editStatus',
    method: 'put',
    params: query
  })
}
// 根据分类id查询商品
export function goodName(query) {
  debugger
  return request({
    url: '/shopping/mallProduct/goodName',
    method: 'get',
    params: query
  })
}




// 查询商城商品列表
export function listMallProduct(query) {
  return request({
    url: '/shopping/mallProduct/list',
    method: 'get',
    params: query
  })
}

// 根据商城订单中的商品id查询商城商品列表
export function getProduct(query) {
  return request({
    url: '/shopping/mallProduct/getProduct',
    method: 'get',
    params: query
  })
}


// 查询商城商品详细
export function getMallProduct(id) {
  return request({
    url: '/shopping/mallProduct/' + id,
    method: 'get'
  })
}

// 新增商城商品
export function addMallProduct(data) {
  return request({
    url: '/shopping/mallProduct',
    method: 'post',
    data: data
  })
}

// 修改商城商品
export function updateMallProduct(data) {
  return request({
    url: '/shopping/mallProduct',
    method: 'put',
    data: data
  })
}

// 删除商城商品
export function delMallProduct(id) {
  return request({
    url: '/shopping/mallProduct/' + id,
    method: 'delete'
  })
}
// 删除商城商品
export function logicDelMallProduct(id) {
  return request({
    url: '/shopping/mallProduct/' + id,
    method: 'delete'
  })
}

// 导出商城商品
export function exportMallProduct(query) {
  return request({
    url: '/shopping/mallProduct/export',
    method: 'get',
    params: query
  })
}
